package com.gdqy.FCS.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gdqy.FCS.dao.FabricDao;
import com.gdqy.FCS.entity.Fabric;
import com.gdqy.FCS.entity.FabricApplication;
import com.gdqy.FCS.entity.FabricProduction;

@Service
@Transactional
public class FabricService {
	@Autowired
	private FabricDao fabricDao;

	public int insert(Fabric fabric) {
		return fabricDao.insert(fabric);
	}
	
	public int update(Fabric fabric){
		return fabricDao.update(fabric);
	}
	
	public int deleteById(Integer id){
		return fabricDao.deleteById(id);
	}
	
	public List<Fabric> selectAll(Fabric fabric){
		return fabricDao.selectAll(fabric);
	}	
	
	public Fabric selectById(Integer id){
		return fabricDao.selectById(id);
	}
	
	public List<Fabric> selectByCode(String code){
		return fabricDao.selectByCode(code);
	}
	
	public List<Fabric> selectByComponent_code(String component_code){
		return fabricDao.selectByComponent_code(component_code);
	}
	
	
	public  List<Fabric> selectFabircByReleasetime(Integer pid){
		return fabricDao.selectFabircByReleasetime(pid);
	}

	public List<Fabric> selectFabircByCollected(int pid) {
		// TODO Auto-generated method stub
		return fabricDao.selectFabircByReleasetime(pid);
	}
	
	public int selectAllCount(){
		return fabricDao.selectAllCount();
	}
	
	public int selectCountByProvider_id(int  provider_id) {
		return fabricDao.selectCountByProvider_id(provider_id);
	}
	
	public List<FabricApplication> selectFabricByAppCode(String production_code) {
		return fabricDao.selectFabricByAppCode(production_code);
	}
	
	public List<FabricProduction> selectFabricByProCode(String production_code){
		return fabricDao.selectFabricByProCode(production_code);
	}
	
	public List<Fabric> selectByComAndWeaCode(Map map){
		return fabricDao.selectByComAndWeaCode(map);
	}
}
